<%@page contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		<title>收入</title>
		<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/shouru.js"></script>
		
	<script type="text/javascript">
//     		$(function(){
//     			var date = new Date();
//     			/*alert(date.toLocaleDateString());
//     			alert(date.toLocaleString());
//     			alert(date.toLocaleTimeString());*/
//     			$("#Bussiness").val(date.toLocaleDateString());
//     			$("#Last").val(date.toLocaleDateString());
//     			$("#Last1").val(date.toLocaleDateString());
//     		});
    </script>
	<style>
		.pagination.square {
			margin: 0; /* 去除外边距*/
			}
			
			.pagination.square > li > a,
			.pagination.square > li > span {
				margin: 0 5px;
				border: 1px solid #dddddd; /* 设置所有的边框都为1像素*/
			}
			.pagination.square > li:first-child > a,
			.pagination.square > li:first-child > span,
			.pagination.square > li:last-child > a,
			.pagination.square > li:last-child > span {
				margin-left: 0px;
				padding-left: 10px;
				padding-right: 10px;
				border-radius: 0px; /* 取消圆角*/
			}
		.abc tr{
			height: 26px;
		}
		/* .abc>tr>td{
		    text-align: center;
		    height: 36px;
		    line-height: 36px !important;
		    padding:0 !important;
		} */
	</style>
	
	</head>
	<body>
	<!-- Modal1 新增 -->
		<div class="modal fade" id="newPopUp" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title" id="myModalLabel">Add Income</h4>
		      </div>
		      <div class="modal-body">
		    	<form action="${pageContext.request.contextPath}/revenue.do" class="form-horizontal">
		    		<div class="btn-group">
						<select class="btn btn-default dropdown-toggle" id="select">
							
						</select>
					</div>
					<div class="form-group">
		    			<label for="inputPassword3" class="col-sm-4 control-label">Bussiness Date</label>
		    			<div class="col-sm-8"><input type="Date" class="form-control" id="Bussiness">
		    			</div>
		    		</div>
		    		<div class="form-group">
						<label for="inputPassword3" class="col-sm-4 control-label">Last mod Date</label>
						<div class="col-sm-8">
							<input type="Date" class="form-control" id="Last">
						</div>
		    		</div>
		    		<div class="form-group">
		    			<label for="inputPassword3" class="col-sm-4 control-label" id="DailyIncome">	Daily Income</label>
		    			<div class="col-sm-8">
		    				<input type="text" class="form-control" id="Text1">
		    			</div>
		    		</div>
		    	</form>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-success" id="btnCreate">Create</button>
		        <button type="button" class="btn btn-warning" id="btnReset">Reset</button>
		        <button type="button" class="btn btn-danger" id="btnCancel" data-dismiss="modal">Cancel</button>
		      </div>
		    </div>
		  </div>
		</div>
		
		<!-- Modal2 修改 -->
		<div class="modal fade" id="modify" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title" id="myModalLabel">Update Income</h4>
		      </div>
		      <div class="modal-body">
		    	<form class="form-horizontal">
		    		<div class="form-group">
		    			<label for="inputEmail3" class="col-sm-4 control-label">Add Income</label>
		    			<div class="col-sm-8"><input type="Name" class="form-control" id="Name1">
		    			</div>
		    		</div>
		    		<div class="form-group">
		    			<label for="inputPassword3" class="col-sm-4 control-label">Bussiness Date</label>
		    			<div class="col-sm-8"><input type="Bussiness" class="form-control" id="Bussiness1" placeholder="不修改" disabled>
		    			</div>
		    		</div>
		    		<div class="form-group">
						<label for="inputPassword3" class="col-sm-4 control-label">Last mod Date</label>
						<div class="col-sm-8">
							<input type="text" class="form-control" id="Last1">
						</div>
		    		</div>
		    		<div class="form-group">
		    			<label for="inputPassword3" class="col-sm-4 control-label">	Daily Income</label>
		    			<div class="col-sm-8">
		    				<input type="text" class="form-control" id="Text2">
		    			</div>
		    		</div>
		    	</form>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-primary" id="btnUpdate">修改</button>
		        <button type="button" class="btn btn-warning" id="btnReset1">Reset</button>
		        <button type="button" class="btn btn-success" id="btnCancel" data-toggle="modal" data-target="#newPopUp" data-backdrop="static" data-dismiss="modal">Add Department</button>
		      </div>
		    </div>
		  </div>
		</div>
		
		<h2 style="text-align: center;">收入管理</h2>
		<div class="panel panel-default">
			<div class="panel-heading clearfix">
				<div class="pull-left">
					<a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/zal.do?method=0">返回</a>
					<button class="btn btn-success" data-toggle="modal" data-target="#newPopUp" data-backdrop="static" id="address">Add Income</button>
				</div>
			</div>
			
			
		<table id="List" class="table table-bordered table-hover">
			<thead>
				<tr>
					<td>Department Name</td>
					<td>Bussiness Date</td>
					<td>Last mod Date</td>
					<td>Daily Income</td>
					<td>modify</td>
				</tr>
			</thead>
			<c:forEach items="${datas['revenue']}" var="revenue">
			<tbody class="abc">
				<tr>
					<td incomeId="${revenue.id}">${revenue.departmentName }</td>
					<td>${revenue.bussinessDate }</td>
					<td>${revenue.lastmodDate }</td>
					<td class="shouru">${revenue.dailyIncome }</td>
					<td align="center"><button type="button" class="btn btn-primary alterIncome" data-toggle="modal" data-target="#modify" data-backdrop="static">修改</button></td>
				</tr>
			</tbody>
			</c:forEach>
		</table>
		
		
		<ul class="list-group">
			<li class="list-group-item">
				<ul class="pagination square">
					<li class="active"><a href="${pageContext.request.contextPath}/revenue.do?currentPage=1">首页<span class="sr-only">(current)</span></a></li>
					<li><a href="${pageContext.request.contextPath}/revenue.do?currentPage=${page.currentPage-1}">上一页</a></li>
					<li><a href="${pageContext.request.contextPath}/revenue.do?currentPage=${page.currentPage+1}">下一页</a></li>
					<li><a href="${pageContext.request.contextPath}/revenue.do?currentPage=${page.totalPage}">尾页</a></li>
				</ul>
				
			</li>
		</ul>
		</div>
		
	</body>
</html>